﻿using System.Web.Security; 

namespace Stimulus360.Services.Interfaces
{
    public interface IMembershipService
    {
        /// <summary>
        ///     The allowed minimum length of the password
        /// </summary>
        int MinPasswordLength { get; }

        /// <summary>
        ///     Method to validate the user 
        /// </summary>
        /// <param name="userName">
        ///     Username provided for validation
        /// </param>
        /// <param name="password">
        ///     Password provided for validation
        /// </param>
        /// <returns>
        ///     Bool indicating if user is valid or not.
        /// </returns>
        bool ValidateUser(string userName, string password);

        /// <summary>
        ///     Method to create a new user in the system
        /// </summary>
        /// <param name="userName">
        ///     The username provided by the user
        /// </param>
        /// <param name="password">
        ///     The Password provided by the user
        /// </param>
        /// <param name="email">
        ///     The email provided by the user
        /// </param>
        /// <returns>
        ///     Membership status.
        /// </returns>
        MembershipCreateStatus CreateUser(string userName, string password, string email);

        /// <summary>
        ///     Method to allow the user change his password
        /// </summary>
        /// <param name="userName">
        ///     The Username
        /// </param>
        /// <param name="oldPassword">
        ///     The existing password
        /// </param>
        /// <param name="newPassword">
        ///     The new password
        /// </param>
        /// <returns>
        ///     Bool indicating if password was successfully changed
        /// </returns>
        bool ChangePassword(string userName, string oldPassword, string newPassword);

        /// <summary>
        ///     Method to check if a username already exists
        /// </summary>
        /// <param name="userName">
        ///     The username to check
        /// </param>
        /// <returns>
        ///     Bool indicating if the username is already in use.
        /// </returns>
        bool UserExists(string userName);
    }
}
